package com.hy.usercenter.utils;

import com.hy.usercenter.constants.UserConstant;
import com.hy.usercenter.model.domain.SysUser;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @Description 用于获取当前用户状态
 *
 * @Author minsf
 * @Date 2023/2/23
 */
public class UserHelper {

    public static SysUser getCurrentUserInfo() {
        HttpServletRequest request = HttpUtils.getRequest();
        HttpSession session = request.getSession();

        return (SysUser) session.getAttribute(UserConstant.USER_LOGIN_STATE);
    }
}
